<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fn" uri="http://www.hds.com.cn/hds-functions"%>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>用户管理</title>
<link rel="stylesheet" href="styles/bootstrap.min.css">
<script src="scripts/jquery.min.js"></script>
<script src="scripts/bootstrap.min.js"></script>
</head>
<body>
	<div class="panel panel-default">
		<div class="panel-body">
			<shiro:hasPermission name="system:user:create">
				<input type="button" class="btn btn-info" id="addUser" href="usersAction!showCreateForm.action"  value="&nbsp;新增用户" data-toggle="modal" data-target="#myModal" style="font-size: 16px" />
			</shiro:hasPermission>
			<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
				<div class="modal-dialog">
					<div class="modal-content"></div>
				</div>
			</div>
		</div>
		<table class="table table-hover">
			<thead class="row">
				<tr>
					<th class="col-md-2 col-sm-2">用户名</th>
					<th class="col-md-2 col-sm-2">角色</th>
					<th class="col--md-2 col-sm-2">邮箱</th>
					<th class="col--md-2 col-sm-2">电话</th>
					<th class="col--md-2 col-sm-2">创建时间</th>
					<th class="col--md-3 col-sm-3">操作</th>
				</tr>
			</thead>
			<tbody>
				<c:forEach items="${userList}" var="user">
					<tr>
						<td>${user.username}</td>
						<td>${fn:roleName(user.roleId)}</td>
						<td>${user.email}</td>
						<td>${user.phone}</td>
						<td>${user.createTime}</td>
						<td>
							<shiro:hasPermission name="system:user:update">
								<a href="usersAction!showUpdateForm.action?id=${user.id}" data-toggle="modal" data-target="#myModal"><span style="padding-right:1em;" class="glyphicon glyphicon-pencil"></span></a> 
							</shiro:hasPermission>
							<shiro:hasPermission name="system:user:delete">
								<a href="usersAction!showDeleteForm.action?id=${user.id} " data-toggle="modal" data-target="#myModal"><span style="padding-right:1em;" class="glyphicon glyphicon-trash"></span></a>
							</shiro:hasPermission>
						</td>
					</tr>
				</c:forEach>
			</tbody>
		</table>
	</div>
</body>
</html>